package org.luxor.common.netty.protocol.handler.connect;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import org.luxor.common.netty.protocol.message.NettyDisconnectMessage;

/**
 * 断开连接通知
 *
 * @author Mr.yan @date 2023/12/10
 */
public class DisconnectMessageHandler extends SimpleChannelInboundHandler<NettyDisconnectMessage> {

    @Override
    public void channelRead0(ChannelHandlerContext ctx, NettyDisconnectMessage disconnectMessage) throws Exception {
        ctx.fireChannelInactive();
        ctx.close();
    }

}
